﻿<Page x:Class="PFC.Program.Profile.Pages.Wallets"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:PFC.Program.Profile.Pages"
      xmlns:ScottPlot="clr-namespace:ScottPlot;assembly=ScottPlot.WPF"
      mc:Ignorable="d"
      xmlns:n="clr-namespace:PFC.CustomControls"
      d:DesignHeight="400" 
      d:DesignWidth="800"
      Title="Wallets">

    <Page.Resources>
        
        <!--Кастомный ListBox-->
        <DataTemplate x:Key="CustomListBox">
            <Grid Background="White">

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="180"/>
                </Grid.ColumnDefinitions>

                <Label Content="{Binding Name}"
                       Grid.Column="0"
                       VerticalAlignment="Center"
                       HorizontalAlignment="Left"
                       BorderBrush="#FFFF8000"
                       BorderThickness="1"
                       FontSize="15"
                       FontFamily="Calibri"
                       Width="90"
                       Margin="5">

                    <Label.Resources>
                        <Style TargetType="Border">
                            <Setter Property="CornerRadius" 
                                    Value="5 0 0 5"/>
                        </Style>
                    </Label.Resources>

                </Label>

                <Label Content="{Binding Balance}"
                       Grid.Column="1"
                       VerticalAlignment="Center"
                       HorizontalAlignment="Left"
                       Width="175"
                       FontSize="15"
                       FontFamily="Calibri"
                       Margin="0 5 5 5"
                       BorderBrush="#FFFF8000"
                       BorderThickness="1">
                    
                    <Label.Resources>
                        <Style TargetType="Border">
                            <Setter Property="CornerRadius" 
                                    Value="0 5 5 0"/>
                        </Style>
                    </Label.Resources>
                    
                </Label>

            </Grid>
            </DataTemplate>
    </Page.Resources>
    
    <Grid Background="#FFFF8000">

        <!--Стек с элементами-->
        <StackPanel Orientation="Vertical">

            <Label Content="Кошельки"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Top"
                   FontSize="20"
                   Margin="0 10 0 0"
                   Foreground="White"/>

            <!--Список кошельков-->
            <ListBox Name="listWallets_Lbx"
                     ItemTemplate="{DynamicResource CustomListBox}"
                     d:ItemsSource="{d:SampleData ItemCount=3}"
                     Width="300"
                     Height="250"
                     HorizontalAlignment="Center"
                     VerticalAlignment="Top"
                     SelectionChanged="listWallets_Lbx_SelectionChanged">

                <ListBox.Resources>
                    <Style TargetType="Border">
                        <Setter Property="CornerRadius"
                               Value="5"/>
                    </Style>
                </ListBox.Resources>

            </ListBox>

            <!--Кнопка перехода на страницу добавления кошелька-->
            <WrapPanel Name="AddNewWallet_Wrap"
                       HorizontalAlignment="Center"
                       ButtonBase.Click="AddNewWallet_Wrap_Click">

                <n:NavButton ImageSource="/Resources/add.png"
                             Width="50"
                             Height="50"
                             NavUri="/Program/Profile/Pages/CreateWallet.xaml"/>
            </WrapPanel>


        </StackPanel>

        <!--Круговая диаграмма-->
        <Border Name="PiePlotBorder"
                BorderBrush="White"
                BorderThickness="2"
                Visibility="Hidden"
                Width="210"
                HorizontalAlignment="Right"
                Margin="0 0 20 55"
                Height="200">

            <Border.Resources>
                <Style TargetType="Border">
                    <Setter Property="CornerRadius"
                               Value="5"/>
                </Style>
            </Border.Resources>
            
            <ScottPlot:WpfPlot x:Name="PiePlot"/>
        </Border>

        <!--График-->
        <Border Name="GraphPlotBorder"
                Visibility="Hidden"
                Width="210"
                BorderBrush="White"
                BorderThickness="2"
                HorizontalAlignment="Left"
                Margin="20 0 0 55"
                Height="200">

            <Border.Resources>
                <Style TargetType="Border">
                    <Setter Property="CornerRadius"
                               Value="5"/>
                </Style>
            </Border.Resources>

            <ScottPlot:WpfPlot x:Name="GraphPlot"/>
        </Border>

    </Grid>

</Page>
